]> dgit.raspbian.org Git - gnome-shell.git/commit
timeLimitsManager: Hold inhibitor for sleep to allow saving screen time data
authorPhilip Withnall <pwithnall@gnome.org>
Thu, 20 Feb 2025 17:06:32 +0000 (17:06 +0000)
committerMarge Bot <marge-bot@gnome.org>
Mon, 3 Mar 2025 15:15:25 +0000 (15:15 +0000)
commitf8024a544757b15f455775ce46229d81214da272
treee9764fa2b1ce5e7c14f2b852198cb9c2d92fe383
parent6a43b6f5514e414d8b9065c3f51637fd884bce88
timeLimitsManager: Hold inhibitor for sleep to allow saving screen time data

This avoids the race between systemd emitting the `prepare-for-sleep`
signal, gnome-shell then starting to write the screen time data to disk,
and systemd suspending the hardware.

The race isn’t so much of an issue if the suspend succeeds (if
gnome-shell loses, the data will still get written out when the machine
resumes), but it’s slightly problematic if the machine loses power while
suspended, as that means the latest screen time data is lost.

Includes significant suggestions from Florian Müllner.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3643>
js/misc/timeLimitsManager.js
tests/unit/timeLimitsManager.js